import numpy as np
class MultiLayerNet:
    def __init__(self):
        self.x=None
        self.y=None
    def forward(self,x,y):
        self.x = x
        self.y = y
        out=self.x*self.y
        return out
    def backward(self,dout):
        dx=dout*self.y
        dy=dout*self.x
        return dx,dy
class AddLayerNet:
    def __init__(self):
        self.x=None
        self.y=None
    def forward(self,x,y):
        return (x+y)
    def backward(self,dout):
        dx=dout*1
        dy=dout*1
        return dx,dy


